package com.bwie.controller;

import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author GaoYiJie
 * @Description
 * @Create 2025/3/6 9:20
 * @Version 1.0
 */
@RestController
@RequestMapping("/user/user")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * 发送验证码
     * @param phone
     * @return
     */
    @PostMapping("/sendPhoneCode/{phone}")
    public R sendPhoneCode(@PathVariable("phone") String phone){
        return userService.sendPhoneCode(phone);
    }

    /**
     * 头像上传
     * @param file
     * @return
     */
    @PostMapping("/uploadImage")
    public R uploadImage(@RequestPart("file") MultipartFile file){
        return userService.uploadImage(file);
    }

    /**
     * 枚举获取性别
     */
    @PostMapping("/getSexList")
    public R getSexList(){
        return userService.getSexList();
    }

    /**
     * 获取BMI
     * @return
     */
    @PostMapping("/getBmiList")
    public R getBmiList(){
        return userService.getBmiList();
    }


}
